let str:string = 'acdkjcdeicl'

function num(str:string,val:string):number{
    let num:number=0
    for(let i=0;i<str.length;i++){
        if(str[i] === val){
            num++
        }
    }
    return  num
}
console.log(num(str,'d'));
